<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sp" uri="http://www.springframework.org/tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>后台登录</title>
</head>
<body>
  <form id="loginForm" action="/admin/loginCheck.dhtml" method="post">
    <table class="form_login">
      <caption>用户登录</caption>
      <tr>
        <td colspan="2" class="warnMsg"><sp:message code="${message.info}" text="" /></td>
      </tr>
      <tr>
        <td><label>用户名：</label></td>
        <td><input id="loginName" type="text" name="user.loginname" /><span id="loginNameTip"></span></td>
      </tr>
      <tr>
        <td><label>密码：</label></td>
        <td><input id="pwd" type="password" name="user.pwd" /><span id="pwdTip"></span></td>
      </tr>
      <tr>
        <td><label>验证码：</label></td>
        <td><input id="graphCode" type="text" name="graphCode" /><img id="graphCodeImg" src="/graphCaptcha.jpgx" /></td>
      </tr>
      <tr>
        <td></td>
        <td><input class="button01" type="submit" value="登录" /></td>
      </tr>
    </table>
  </form>
  <script type="text/javascript">
			// 不被包含在 frame中
			if (top.location !== self.location) {
				top.location = self.location;
			}
			$(document).ready(
					function() {
						$("#graphCodeImg").click(
								function() {
									$(this).attr(
											"src",
											"/graphCaptcha.jpg?date="
													+ new Date());
								});

						// 表单验证
						var formCheck = $.formCheck();
						formCheck.regLoginNameLimit("loginName", {
							onShow : "输入用户名",
							onFocus : "用户名由5-20个字母、数字、下划线组成且必须以字母开头",
							onError : "用户名由5-20个字母、数字、下划线组成且必须以字母开头",
							onCorrect : "用户名输入正确"
						}, 5, 20, true);
						formCheck.regPasswordLimit("pwd", {
							onShow : "输入密码",
							onFocus : "密码由5-20个字母、数字、下划线组成",
							onError : "密码由5-20个字母、数字、下划线组成",
							onCorrect : "密码输入正确"
						}, 5, 20, true);
						formCheck.formCheck("loginForm");
					});
		</script>
</body>
</html>